package org.guohao.mockdata;

import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Scene;
import javafx.stage.Screen;
import javafx.stage.Stage;
import org.guohao.mockdata.controller.HomeController;

public class MockDataApplication extends Application {

  @Override
  public void start(Stage stage) throws IOException {
    FXMLLoader fxmlLoader = new FXMLLoader(
        MockDataApplication.class.getResource("/fxml/home.fxml"));
    Rectangle2D screenBounds = Screen.getPrimary().getBounds();
    Scene scene = new Scene(fxmlLoader.load(), screenBounds.getWidth() * 0.6,
        screenBounds.getHeight() * 0.6);
    HomeController controller = fxmlLoader.getController();
    controller.mainStage = stage;
    stage.setTitle("Hello!");
    stage.setScene(scene);
    stage.show();
  }

  public static void main(String[] args) {
    launch();
  }
}